/* 
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

var xhr;
//alert("llegue al js materias");
function buscarDetalle(){
    
    if(window.ActiveXObject){        
        xhr = new ActiveXObject("Microsoft.XMLHttp");
    }
    else if(window.XMLHttpRequest || (typeof XMLHttpRequest)!= undefined){
        xhr = new XMLHttpRequest();
    }
    else{
        alert("su navegador no soporta AJAX");
        return;
    }

}

function checkprimermasde(){
    buscarDetalle();
    xhr.open("GET","../primercuatrimasde",true);
    xhr.onreadystatechange = imprimecheksprimermasde;
    xhr.send(null);
}
function imprimecheksprimermasde(){

    if(xhr.readyState == 4){
        if(xhr.status == 200)    {
            document.getElementById("primermasder").innerHTML=xhr.responseText;
            checksegundomasde();
        }
    }
}


function checksegundomasde(){
    buscarDetalle();
    xhr.open("GET","../segundocuatrimasde",true);
    xhr.onreadystatechange = imprimechekssegundomasde;
    xhr.send(null);
}
function imprimechekssegundomasde(){

    if(xhr.readyState == 4){
        if(xhr.status == 200)    {
            document.getElementById("segundomasder").innerHTML=xhr.responseText;
            checkterceromasde();
        }
    }
}
function checkterceromasde(){
    buscarDetalle();
    xhr.open("GET","../tercerocuatrimasde",true);
    xhr.onreadystatechange = imprimecheksterceromasde;
    xhr.send(null);
}
function imprimecheksterceromasde(){

    if(xhr.readyState == 4){
        if(xhr.status == 200)    {
            document.getElementById("terceromasder").innerHTML=xhr.responseText;
            checkcuartomasde();
        }
    }
}


function checkcuartomasde(){
    buscarDetalle();
    xhr.open("GET","../cuartocuatrimasde",true);
    xhr.onreadystatechange = imprimechekscuartomasde;
    xhr.send(null);
}
function imprimechekscuartomasde(){

    if(xhr.readyState == 4){
        if(xhr.status == 200)    {
            document.getElementById("cuartomasder").innerHTML=xhr.responseText;
            checkquintomasde();
        }
    }
}
function checkquintomasde(){
    buscarDetalle();
    xhr.open("GET","../quintocuatrimasde",true);
    xhr.onreadystatechange = imprimecheksquintomasde;
    xhr.send(null);
}
function imprimecheksquintomasde(){

    if(xhr.readyState == 4){
        if(xhr.status == 200)    {
            document.getElementById("quintomasder").innerHTML=xhr.responseText;
            checksextomasde();
        }
    }
}


function checksextomasde(){
    buscarDetalle();
    xhr.open("GET","../sextocuatrimasde",true);
    xhr.onreadystatechange = imprimechekssextomasde;
    xhr.send(null);
}
function imprimechekssextomasde(){

    if(xhr.readyState == 4){
        if(xhr.status == 200)    {
            document.getElementById("sextomasder").innerHTML=xhr.responseText;
            checkseptimolicde();
        }
    }
}





function checkprimermasce(){
    buscarDetalle();
    xhr.open("GET","../primercuatrimasce",true);
    xhr.onreadystatechange = imprimecheksprimermasce;
    xhr.send(null);
}
function imprimecheksprimermasce(){

    if(xhr.readyState == 4){
        if(xhr.status == 200)    {
            document.getElementById("primermasce").innerHTML=xhr.responseText;
            checksegundomasce();
        }
    }
}


function checksegundomasce(){
    buscarDetalle();
    xhr.open("GET","../segundocuatrimasce",true);
    xhr.onreadystatechange = imprimechekssegundomasce;
    xhr.send(null);
}
function imprimechekssegundomasce(){

    if(xhr.readyState == 4){
        if(xhr.status == 200)    {
            document.getElementById("segundomasce").innerHTML=xhr.responseText;
            checkterceromasce();
        }
    }
}
function checkterceromasce(){
    buscarDetalle();
    xhr.open("GET","../tercerocuatrimasce",true);
    xhr.onreadystatechange = imprimecheksterceromasce;
    xhr.send(null);
}
function imprimecheksterceromasce(){

    if(xhr.readyState == 4){
        if(xhr.status == 200)    {
            document.getElementById("terceromasce").innerHTML=xhr.responseText;
            checkcuartomasce();
        }
    }
}


function checkcuartomasce(){
    buscarDetalle();
    xhr.open("GET","../cuartocuatrimasce",true);
    xhr.onreadystatechange = imprimechekscuartomasce;
    xhr.send(null);
}
function imprimechekscuartomasce(){

    if(xhr.readyState == 4){
        if(xhr.status == 200)    {
            document.getElementById("cuartomasce").innerHTML=xhr.responseText;
            checkquintomasce();
        }
    }
}
function checkquintomasce(){
    buscarDetalle();
    xhr.open("GET","../quintocuatrimasce",true);
    xhr.onreadystatechange = imprimecheksquintomasce;
    xhr.send(null);
}
function imprimecheksquintomasce(){

    if(xhr.readyState == 4){
        if(xhr.status == 200)    {
            document.getElementById("quintomasce").innerHTML=xhr.responseText;
            checksextomasce();
        }
    }
}


function checksextomasce(){
    buscarDetalle();
    xhr.open("GET","../sextocuatrimasce",true);
    xhr.onreadystatechange = imprimechekssextomasce;
    xhr.send(null);
}
function imprimechekssextomasce(){

    if(xhr.readyState == 4){
        if(xhr.status == 200)    {
            document.getElementById("sextomasce").innerHTML=xhr.responseText;
            
        }
    }
}